#pragma once
#include "Effect.h"
#include "Gaussian.h"
#include <vector>

using namespace std;

class PostProcess:
	public Effect
{
public:
	PostProcess(const LPDIRECT3DDEVICE9 device, EffectManager *effMgr, TextureManager *texMgr);

	~PostProcess(void);

	void blurTexture(
		const LPDIRECT3DTEXTURE9 inputTex,
		LPDIRECT3DSURFACE9 targetSurface,
		ModelMesh *quad,
		LPDIRECT3DSURFACE9 prevSurf);

	void bloom(
		const LPDIRECT3DTEXTURE9 normalTex,
		const LPDIRECT3DTEXTURE9 blurredTex,
		ModelMesh *quad,
		LPDIRECT3DSURFACE9 prevSurf);

	void depthOfField(
		const LPDIRECT3DTEXTURE9 normalTex,
		const LPDIRECT3DTEXTURE9 blurredTex,
		const LPDIRECT3DTEXTURE9 depthTex,
		Camera* camera,
		ModelMesh *quad,
		const FLOAT distance,
		const FLOAT length,
		LPDIRECT3DSURFACE9 prevSurf);

	void runEffect() {}

private:

	void blurTexture(
		const LPDIRECT3DTEXTURE9 blurTexture,
		const vector<D3DXVECTOR4> sampleOffsets, 
		const vector<float> sampleWeights,
		ModelMesh *quad);

	Gaussian *gaussian;
};
